package casa.depesos.app.com.dlg;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import casa.depesos.app.com.databinding.DlgHow2Binding;


public class TipDlg extends FullScreenDlg {

    DlgHow2Binding binding;
    String title, msg;

    public TipDlg setMsg(String title, String msg) {
        this.title = title;
        this.msg = msg;
        return this;
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        binding = DlgHow2Binding.inflate(inflater, container, false);
        binding.ok.setOnClickListener(v -> dismiss());
        if (!TextUtils.isEmpty(title)) {
            binding.title.setText(title);
        }
        if (!TextUtils.isEmpty(msg)) {
            binding.tv.setText(msg);
        }
        return binding.getRoot();
    }
}
